<?php
/* @var $this KelurahanController */
/* @var $model Kelurahan */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'kelurahan-form',
	'enableAjaxValidation'=>false,
)); ?>

	<!--<p class="note">Fields with <span class="required">*</span> are required.</p>-->

	<?php echo $form->errorSummary($model); ?>

<table border="0" cellpadding="0" cellspacing="0" id="id-form">
    
         <tr>
            <th valign="top"><?php echo $form->labelEx($model,'nama_kelurahan'); ?></th>
            <td class="idform">
               	<?php echo $form->textField($model,'nama_kelurahan',array('size'=>60,'maxlength'=>255)); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('nama_kelurahan')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'nama_kelurahan', array('class' => 'error-inner')); ?>
            </td>
        </tr>
    
           <tr>
            <th valign="top">	<?php echo $form->labelEx($model,'id_kecamatan'); ?></th>
            <td class="idform">
                <?php echo $form->dropDownList($model, 'id_kecamatan', $list_parent, array(
                'empty' => '(Pilih Kecamatan)',
                'style' => 'width:200px')); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('id_kecamatan')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'id_kecamatan', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <?if (!$model->isNewRecord) : ?>
        <tr>
            <th>&nbsp;</th>
            <td valign="top">
                <?php
                echo l('Tambah Pengurus', url('kelurahananggota/create', array('id' => $model->id_kelurahan)));
                $this->widget('zii.widgets.grid.CGridView', array(
                    'id' => 'kelurahan-anggota-grid',
                    'dataProvider' => $model_anggota->search(),
                    'columns' => array(
                        array(
                            'header' => 'Laskar',
                            'name' => 'laskar_',
                            'type' => 'raw',
                            'value' => '$data->idLaskar->nama'),
                            
                        //'jabatan',
                        
                          array(
                                'header' => 'Jabatan',
                                'name' => 'jabatan',
                                'type' => 'raw',
                                'value' => 'U::getPengurusKelurahan($data["jabatan"])'
                            ),
                            
                                 array
                                    (
                                    'class'=>'CButtonColumn',
                                    'template'=>' {update}   {delete}',
                                    'buttons'=>array
                                    (
                                        'update' => array
                                        (
                                            'label'=>'update',
                                            'imageUrl'=>bu().'/img/update.png',
                                            'url'=>'Yii::app()->createUrl("kelurahananggota/update", array("id"=>$data->id_anggota))',
                                        ),
                                        
                                        
                                        'delete' => array
                                        (
                                            'label'=>'hapus',
                                            'imageUrl'=>bu().'/img/delete.png',
                                            'url'=>'Yii::app()->createUrl("kelurahananggota/delete", array("id"=>$data->id_anggota))',
                                        ),
                                        
                                    ),
                                ),
                        
                        ),)); ?>
            </td>
            <td class="idform"></td>
        </tr>
        <? endif;?>
      <tr>
            <th>&nbsp;</th>
            <td valign="top">
               <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
            </td>
            <td class="idform"></td>
        </tr>
</table>

	<!--<div class="row">
		<?//php echo $form->labelEx($model,'nama_kelurahan'); ?>
		<?//php echo $form->textField($model,'nama_kelurahan',array('size'=>60,'maxlength'=>255)); ?>
		<?//php echo $form->error($model,'nama_kelurahan'); ?>
	</div>

	<div class="row">
		<?//php echo $form->labelEx($model,'id_kecamatan'); ?>
		<?//php echo $form->textField($model,'id_kecamatan'); ?>
		<?//php echo $form->error($model,'id_kecamatan'); ?>
	</div>

	<div class="row buttons">
		<?//php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>-->

<?php $this->endWidget(); ?>

</div><!-- form -->